﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;
using Mono.Cecil.Cil;
using AgileNETSlayer.Core;
using AgileNETSlayer.Transforms;

namespace AgileNETSlayer
{
    class Program
    {
        static AssemblyDefinition assembly;
        static double version = 0.1;
        static string file = @"C:\Users\JAdamita\Desktop\Secured\CrackMe_3";

        static List<ITransform> transforms = new List<ITransform>();

        static void Main(string[] args)
        {
            Console.WriteLine("Agile.NET Slayer - " + version.ToString());
            Console.WriteLine("0xe9 - 2012 - https://agilenetslayer.codeplex.com/");
            Console.WriteLine();
            Console.WriteLine("Deobfuscating " + file + ".exe");
            Console.WriteLine("-------------------------");
            Console.WriteLine();

            assembly = AssemblyDefinition.ReadAssembly(file + ".exe");

            runTransforms();
            
            assembly.Write(file + "_slayed" + ".exe");
            Console.WriteLine();
            Console.WriteLine("-------------------------");
            Console.WriteLine("Deobfuscated Successfully! ");

            Console.Read();
        }

        static void runTransforms()
        {
            transforms.Add(new ProxyCall(assembly));
        }
    }
}
